package ServerSocket2;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Scanner;

/**
 * Created by 旧 on 2018/8/11.
 */
public class SeverDuan {
    //服务端
    public static void main(String[] args) throws IOException {
        Scanner scanner=new Scanner(System.in);
        //1.创建服务端的IP
        ServerSocket serverSocket = new ServerSocket(8000);
        System.out.println(" 服务端启动成功！");
        while (true){
            //2.等待客户端请求 accept()
            Socket cliet = serverSocket.accept();

            xiaozhuzhu zhu=new xiaozhuzhu();
            zhu.cliet=cliet;
            zhu.start();

        }
        //serverSocket.close();
    }
}
